<template>
    <div>
        <table class="mb-tb" style="width: 80%;margin: 5% 10% 0 10%">
            <tr>
                <td class="mb-blue">用户名</td>
                <td >{{formData.userName}}</td>
                <td class="mb-blue">昵称</td>
                <td >{{formData.realName}}</td>
            </tr>
            <tr>
                <td class="mb-blue">学校名称</td>
                <td >{{formData.deptName}}</td>
                <td class="mb-blue">邮箱</td>
                <td >{{formData.email}}</td>
            </tr>
            <tr>
                <td class="mb-blue">二级学院</td>
                <td >{{formData.secondaryCollege}}</td>
                <td class="mb-blue">专业</td>
                <td >{{formData.profession}}</td>
            </tr>
            <tr>
                <td class="mb-blue">电话号码</td>
                <td >{{formData.mobilePhone}}</td>
                <td class="mb-blue">年龄</td>
                <td >{{formData.age}}</td>
            </tr>
            <tr>
                <td class="mb-blue">个性签名</td>
                <td colspan="3">{{formData.autograph}}</td>
            </tr>
            <tr>
                <td class="mb-blue">家庭住址</td>
                <td colspan="3" >{{formData.address}}</td>
            </tr>
        </table>
    </div>
</template>

<script>
    import Base from '@/components/table/BaseView';
    import user from '@/common/user';
    import axiosUtils  from '@/common/axiosUtils';

    export default {
        name: "MyView",
        extends:Base,
        data(){
            axiosUtils.post("/api/system/user/read",{id:user.getUser().id}).then((res)=>{
                this.formData=res;
            });
            /*this.$axios.post("/api/system/user/read",this.$qs.stringify({id:user.getUser().id})).then(res=>{
                let code = res.data.code;
                let data = res.data.data;
                if(code==200){
                    this.formData=data;
                }else{
                    this.$Message.error(data.msg);
                }
            }).catch(()=>{
                this.$Message.error('服务器未响应!');
            });*/
            return {formData:{}}
        },
        methods:{
        }

    }
</script>
<style src="@/assets/css/TableView.css" scoped></style>
<style scoped >
    .mb-tb td:nth-of-type(odd){width: 10%;}
    .mb-tb td:nth-of-type(even){width: 40%}
</style>
